package com.hx.zhg.web.controller.wx;

import com.hx.zhg.web.controller.BaseController;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by zhenghegong on 2020/4/21.
 */
@Controller
@RequestMapping("/wxWeb")
public class WxWebController extends BaseController {
    private static final Logger log = LoggerFactory.getLogger(WxWebController.class);

    //扫描二维码
    private static final String SCANNER_QR_VIEW = "/wxWeb/scanner/qr";
    //DEMO页面
    private static final String DEMO_VIEW = "/wxWeb/demo/demo";

    @ApiOperation(value = "测试页面", notes = "测试页面描述")
    @RequestMapping(value = "/demo")
    public String demo(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) {
        try {
        } catch (Exception e) {
            log.error(String.format("system throw exception error: %s; HEADERS: %s", getHeaders(request), e));
            return ERROR_404(response);
        }
        return DEMO_VIEW;
    }

    @ApiOperation(value = "扫描二维码", notes = "扫描二维码描述")
    @RequestMapping(value = "/qr")
    public String qr(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) {
        try {
        } catch (Exception e) {
            log.error(String.format("system throw exception error: %s; HEADERS: %s", getHeaders(request), e));
            return ERROR_404(response);
        }
        return SCANNER_QR_VIEW;
    }
}
